showOutput
authorJoey Hess <joeyh@joeyh.name>
Fri, 22 Aug 2025 16:54:43 +0000 (12:54 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 22 Aug 2025 16:54:43 +0000 (12:54 -0400)
tahoe store and retrieve both output messages which cannot be shut up with
--quiet. The messages go to stderr, which makes it hard to avoid
displaying them without hiding problems. This kinda sucks.

Using showOutput helps with output formatting, but with -J this output
is still scrambled in with the progress output.

Remote/Tahoe.hs

index 76b17caa5bd72e0d76b79c29ad6dee9bc04f0d8a..8c0d6d1631c772b8dd8b2d595016eafe37ca947e 100644 (file)
@@ -147,7 +147,8 @@ tahoeSetup _ mu _ c _ = do
        missingfurl = giveup "Set TAHOE_FURL to the introducer furl to use."
 
 store :: RemoteStateHandle -> TahoeHandle -> Key -> AssociatedFile -> Maybe OsPath -> MeterUpdate -> Annex ()
-store rs hdl k _af o _p = sendAnnex k o noop $ \src _sz ->
+store rs hdl k _af o _p = sendAnnex k o noop $ \src _sz -> do
+       showOutput
        parsePut <$> liftIO (readTahoe hdl "put" [File (fromOsPath src)]) >>= maybe
                (giveup "tahoe failed to store content")
                (\cap -> storeCapability rs k cap)
@@ -160,8 +161,10 @@ retrieve rs hdl k _f d _p _ = do
        return Verified
   where
        go Nothing = giveup "tahoe capability is not known"
-       go (Just cap) = unlessM (liftIO $ requestTahoe hdl "get" [Param cap, File (fromOsPath d)]) $
-               giveup "tahoe failed to reteieve content"
+       go (Just cap) = do
+               showOutput
+               unlessM (liftIO $ requestTahoe hdl "get" [Param cap, File (fromOsPath d)]) $
+                       giveup "tahoe failed to reteieve content"
 
 remove :: Maybe SafeDropProof -> Key -> Annex ()
 remove _ _ = giveup "content cannot be removed from tahoe remote"